<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2>平台用户</h2>
        <ol class="breadcrumb">
            <li>
                <a href="#">首页</a>
            </li>

            <li class="active">
                <strong>平台用户</strong>
            </li>
        </ol>
    </div>

</div>

<div class="wrapper wrapper-content animated fadeInRight ecommerce">

    <div class="ibox-content m-b-sm border-bottom" id="form1">
        <div class="row">
                        <div class="col-sm-3">
                <div class="form-group">
                    <label class="control-label" for="user_name">用户昵称</label>
                                        <input type="text" id="user_name" name="user_name" placeholder="用户昵称"
                           class="form-control">
                                    </div>
            </div>
                        <div class="col-sm-3">
                <div class="form-group">
                    <label class="control-label" for="user_accouont">用户账号</label>
                                        <input type="text" id="user_accouont" name="user_accouont" placeholder="用户账号"
                           class="form-control">
                                    </div>
            </div>
                        <div class="col-sm-3">
                <div class="form-group">
                    <label class="control-label" for="password">登录密码</label>
                                        <input type="text" id="password" name="password" placeholder="登录密码"
                           class="form-control">
                                    </div>
            </div>
                        <div class="col-sm-3">
                <div class="form-group">
                    <label class="control-label" for="pay_password">支付密码</label>
                                        <input type="text" id="pay_password" name="pay_password" placeholder="支付密码"
                           class="form-control">
                                    </div>
            </div>
                        <div class="col-sm-3">
                <div class="form-group">
                    <label class="control-label" for="send_message">是否推送消息</label>
                    {:W('parts/op',['key'=>'yn','name'=>'send_message'])}

                                    </div>
            </div>
                        <div class="col-sm-3">
                <div class="form-group">
                    <label class="control-label" for="account_balance">账号余额</label>
                                        <input type="text" id="account_balance" name="account_balance" placeholder="账号余额"
                           class="form-control">
                                    </div>
            </div>
                        <div class="col-sm-3">
                <div class="form-group">
                    <label class="control-label" for="device_code">设备编码</label>
                                        <input type="text" id="device_code" name="device_code" placeholder="设备编码"
                           class="form-control">
                                    </div>
            </div>
                        <div class="col-sm-3">
                <div class="form-group">
                    <label class="control-label" for="is_vip">是否是会员</label>
                    {:W('parts/op',['key'=>'yn','name'=>'is_vip'])}
                                    </div>
            </div>
                        <div class="col-sm-3">
                <div class="form-group">
                    <label class="control-label" for="is_stop">是否停用</label>
                    {:W('parts/op',['key'=>'yn','name'=>'is_stop'])}
                                    </div>
            </div>
                    </div>
        <div class="row">
            <div class="col-sm-6">
                <a class="btn btn-success btn-outline" href="#{:U('form')}">
                    <i class="fa fa-edit"></i>
                    <span class="bold">添加</span>
                </a>
            </div>
            <div class="col-sm-6 text-right">
                <button class="btn btn-default" data-op="reset">
                    <i class="fa fa-refresh"></i>
                    <span class="bold">重置</span>
                </button>
                &nbsp;
                &nbsp;
                <button class="btn btn-primary" data-op="search">
                    <i class="fa fa-search"></i>
                    <span class="bold">查询</span>
                </button>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-12">
            <div class="ibox">
                <div class="ibox-content">
                    <table class="footable table table-stripped toggle-arrow-tiny" id="footable">
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(document).ready(function () {
        var table = YFootTable.create('#footable', {
            baseUrl: "{:U('PlateformUser/')}",
            searchForm: '#form1',
            columns: [
                {name:'user_name',title:'用户昵称',sortable: true}
				,{name:'user_accouont',title:'用户账号',sortable: true,breakpoints:'xs sm md'}
				,{name:'password',title:'登录密码',sortable: true,breakpoints:'xs sm md'}
				,{name:'pay_password',title:'支付密码',sortable: true,breakpoints:'xs sm md'}
				,{name:'yn__send_message',title:'是否推送消息',sortable: true,breakpoints:'xs sm md'}
				,{name:'account_balance',title:'账号余额',sortable: true,breakpoints:'xs sm md'}
				,{name:'device_code',title:'设备编码',sortable: true,breakpoints:'xs sm md'}
				,{name:'yn__is_vip',title:'是否是会员',sortable: true,breakpoints:'xs sm md'}
				,{name:'yn__is_stop',title:'是否停用',sortable: true,breakpoints:'xs sm md'}
            ],
            actions: [{
                text:'停用',
                token:'stop',
                handler:function(row){
                    if(row.is_stop == 1){
                        YMessager.alert('已停用');
                        return;
                    }
                    YMessager.confirm('是否确定停用',function () {
                        c.post("{:U('stopUser')}",{id:row.id,is_stop:1},function () {
                            table.loadData();
                        });
                    });
                }
            },{
                text:'启用',
                token:'stop',
                handler:function(row){
                    if(row.is_stop == 0){
                        YMessager.alert('已启用');
                        return;
                    }
                    YMessager.confirm('是否确定启用',function () {
                        c.post("{:U('stopUser')}",{id:row.id,is_stop:0},function () {
                            table.loadData();
                        });
                    });
                }
            },'view', 'edit', 'remove']
        });
    });
</script>